/* $Id: JMapContextMenu.java 60 2010-02-01 19:54:35Z aaron.day $ */
package org.crazydays.gameplan.map.swing;


import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;

import org.crazydays.gameplan.map.action.OpenMapPropertiesDialog;
import org.crazydays.gameplan.map.action.ToggleGrid;

/**
 * JMapContextMenu
 */
public class JMapContextMenu
    extends JPopupMenu
{
    /** serial version uid */
    public final static long serialVersionUID =
        "$Id: JMapContextMenu.java 60 2010-02-01 19:54:35Z aaron.day $"
            .hashCode();

    /** toggle grid */
    protected ToggleGrid toggleGrid;

    /** open map properties dialog */
    protected OpenMapPropertiesDialog openMapPropertiesDialog;

    /**
     * Set toggle grid.
     * 
     * @param toggleGrid ToggleGrid
     */
    public void setToggleGrid(ToggleGrid toggleGrid)
    {
        this.toggleGrid = toggleGrid;
    }

    /**
     * Set open map properties dialog.
     * 
     * @param openMapPropertiesDialog OpenMapPropertiesDialog
     */
    public void setOpenMapPropertiesDialog(
        OpenMapPropertiesDialog openMapPropertiesDialog)
    {
        this.openMapPropertiesDialog = openMapPropertiesDialog;
    }

    /**
     * Initialize menu items.
     */
    public void initialize()
    {
        add(new JMenuItem(toggleGrid));
        addSeparator();
        add(new JMenuItem(openMapPropertiesDialog));
    }
}
